package com.tianzeculture.stagebao.net;

import com.tianzeculture.stagebao.bean.HomeBean;
import com.tianzeculture.stagebao.bean.ReplyBean;
import com.tianzeculture.stagebao.bean.ResultBean;
import com.tianzeculture.stagebao.net.base.AppBaseRestUsageV2;
import com.tianzeculture.stagebao.network.net.httpclient.NewCustomResponseHandler;
import com.tianzeculture.stagebao.util.Util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/10/12.
 */

public class OtherRestUsage extends AppBaseRestUsageV2 {

    private final String SET_REPLY = "/rongCloud/upReply.do";//自动回复设置
    private final String GET_REPLY = "/rongCloud/getReply.do";//获取自动回复内容


    /**
     * 设置自动回复
     */
    public void setReply(int taskId, String autoResponse, String responseMsg) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("autoResponse", autoResponse);
        paramMap.put("responseMsg", responseMsg);
        post(SET_REPLY, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 获取自动回复
     */
    public void getReply(int taskId, String rid) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("rid", rid);
        post(GET_REPLY, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ReplyBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }
}
